package com.guigu.config;


import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: minio配置文件
 * @author: JZC
 * @create: 2024-06-09 14:11
 **/
@Configuration
public class MinioConfig {

    /**
     * minio url
     */
    @Value("${minio.url}")
    private String url;

    /**
     * minio账户
     */
    @Value("${minio.accessKey}")
    private String accessKey;

    /**
     * minio密码
     */
    @Value("${minio.secretKey}")
    private String secretKey;

    /**
     * 构造
     * @return
     */
    @Bean
    public MinioClient getMinioClient(){
       return MinioClient.builder()
               .endpoint(url)
               .credentials(accessKey,secretKey).build();
    }

}
